}
}
-/* Get the pointer grab in effects for events we just sent */
-GdkPointerGrabInfo *
-_gdk_display_get_active_pointer_grab (GdkDisplay *display)
-{
- GdkPointerGrabInfo *info;
-
- if (display->pointer_grabs == NULL)
- return NULL;
-
- info = display->pointer_grabs->data;
-
- if (info->activated)
- return info;
-
- return NULL;
-}
-
-
GdkPointerGrabInfo *
_gdk_display_get_last_pointer_grab (GdkDisplay *display)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
- info = _gdk_display_get_active_pointer_grab (display);
+ /* What we're interested in is the steady state (ie last grab),
+ because we're interested e.g. if we grabbed so that we
+ can ungrab, even if our grab is not active just yet. */
+ info = _gdk_display_get_last_pointer_grab (display);
if (info)
{
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
- info = _gdk_display_get_active_pointer_grab (display);
+ /* What we're interested in is the steady state (ie last grab),
+ because we're interested e.g. if we grabbed so that we
+ can ungrab, even if our grab is not active just yet. */
+ info = _gdk_display_get_last_pointer_grab (display);
return (info && !info->implicit);
}